package com.nk.iexam;

import com.nk.iexam.ds.TestDBOpenHelper;

import android.app.Application;
import android.database.sqlite.SQLiteDatabase;

public class IExamApplication extends Application 
{
	private TestDBOpenHelper _dbHelper;
	private static SQLiteDatabase _database;
		
	@Override
	public void onCreate()
	{
		super.onCreate();
		_dbHelper = new TestDBOpenHelper(getApplicationContext());
		_database = _dbHelper.getReadableDatabase();
	}
	
	@Override
	public void onTerminate() {
		_dbHelper.close();
		super.onTerminate();
	}
	
	public static SQLiteDatabase getDB()
	{
		return _database;
	}	
}
